package com.example.demo.config

import jakarta.annotation.Resource
import org.ktorm.database.Database
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import javax.sql.DataSource

/**
 * Ktorm配置类
 */
@Configuration
class KtormConfiguration {
    @Resource
    lateinit var dataSource : DataSource
    @Bean
    fun database(): Database {
        return Database.connectWithSpringSupport(dataSource)
    }
}